package XB;

import java.util.Scanner;
public class Main {
    public static double s=0.2;
    public static void main(String[] args) {
        Student student1=new Student("张三","无","无","无",0);
        Student student2=new Student("华强","无","无","无",0);
        Task task1=new Task("计算机网络实验室","无");
        Task task2=new Task("组成原理实验室","无");
        Task task3=new Task("大学物理实验室","无");
        Laboratory laboratory1=new Laboratory("计算机网络实验室");
        Laboratory laboratory2=new Laboratory("组成原理实验室");
        Laboratory laboratory3=new Laboratory("大学物理实验室");
        Inspect inspect1=new Inspect(0);
        Inspect inspect2=new Inspect(0);
        Inspect inspect3=new Inspect(0);
        final double t=800;
        double quan1=0,quan2=0;
        String[] a={"无","无","无","无","无"},b={"无","无","无","无","无"};
        String[] c={"无","无","无","无","无"},d={"无","无","无","无","无"};
        String[] a1={"无","无","无","无","无"},a2={"无","无","无","无","无"},a3={"无","无","无","无","无"};
        System.out.println("按1进入系统,按其他键退出系统");
        Scanner input0= new Scanner(System.in);
        int c0 = input0.nextInt();
        while(c0==1){
            System.out.println("按1进入选任务系统,按2进入执行任务系统,按3进行评分环节系统,按4结束系统");
            Scanner input1 = new Scanner(System.in);
            int c1 = input1.nextInt();
        while(c1==1){
            System.out.println("按1选择学生张三，按2选择学生华强，按3返回上一级");
            Scanner input2 = new Scanner(System.in);
            int c2 = input2.nextInt();
            task1.choice(student1,student2,task1,task2,task3,c2);
            if(c2==3){
                break;
            }
            }
        while(c1==2){
            System.out.println("按1选择学生张三，按2选择学生华强，按3返回上一级");
            Scanner input3 = new Scanner(System.in);
            int c3 = input3.nextInt();
            laboratory1.shengcheng(student1,student2,c3,a1,a2,a3);
            laboratory1.degree=a1;
            laboratory2.degree=a2;
            laboratory3.degree=a3;
            if(c3==3){
                break;
            }}
        while(c1==3){
            System.out.println("一次优1200补助，一次良800补助,一次及格600补助");
            System.out.println("按1计算费用并打印记录，按2返回上一级");
            Scanner input4 = new Scanner(System.in);
            int c4 = input4.nextInt();
            if(c4==1){
            inspect1.look(laboratory1,inspect1,a);
            inspect1.look(laboratory2,inspect2,b);
            inspect1.look(laboratory3,inspect3,c);
            if(student1.task1!="无"){
                student1.record1=a;
                student2.record1=d;
                quan1=quan1+inspect1.money;
            }
            if(student2.task1!="无"){
                student2.record1=a;
                student1.record1=d;
                quan2=quan2+inspect1.money;
            }
            if(student1.task2!="无"){
                student1.record2=b;
                student2.record2=d;
                quan1=quan1+inspect2.money;
            }
            if(student2.task2!="无"){
                student2.record2=b;
                student1.record2=d;
                quan2=quan2+inspect2.money;
            }
            if(student1.task3!="无"){
                student1.record3=c;
                student2.record3=d;
                quan1=quan1+inspect3.money;
            }
            if(student2.task3!="无"){
                student2.record3=c;
                student1.record3=d;
                quan2=quan2+inspect3.money;
            }
            jisuan(quan1,t,student1);
            jisuan(quan2,t,student2);
            System.out.println(student1);
            System.out.println(student2);}
            if(c4==2){
                break;
            }
        }
            if(c1==4){
            break;
        }

    }
}
    public static void jisuan(double quan,double t,Student student){
        double r=0;
        if(quan>=800){
            r=quan-s*(quan-t);}
        if(quan<800){
            r=quan;
        }
        student.money=r;
    }
}
